﻿using System;
using System.Collections.Generic;

using Microsoft.Practices.ServiceLocation;

namespace Fuse8.DomainFramework.Common.Locator
{
    /// <summary>
    /// Extend <see cref="IServiceLocatorEx" /> to support lazy load IoC (first call initialization)
    /// </summary>
    public interface IServiceLocatorWithLazy : IServiceLocatorEx
    {
        /// <summary>
        /// Define lazy delegate for invoking by first calling
        /// </summary>
        /// <typeparam name="T">Type of registered service</typeparam>
        /// <param name="action">Delegate of <see cref="LazyInitLocatorAction"/> type</param>
        void DefineInitAction<T>(LazyInitLocatorAction action);

        /// <summary>
        /// Define lazy delegate for invoking by first calling
        /// </summary>
        /// <param name="type">Type of registered service</param>
        /// <param name="action">Delegate of <see cref="LazyInitLocatorAction"/> type</param>
        void DefineInitAction(Type type, LazyInitLocatorAction action);
    }
}
